import request from '@/utils/request.js'

// order 租 买
export function orderList(data) {
    return request({
        url: '/njnzzs/merchant/ordersOfMerchant',
        method: 'GET',
        data
    })
}

// order 换
export function orderExchange(data) {
    return request({
        url: '/njnzzs/merchant/exchangeApplies',
        method: 'GET',
        data
    })
}

// order 还
export function orderReturn(data) {
    return request({
        url: '/njnzzs/merchant/returnApplies',
        method: 'GET',
        data
    })
}

// order info
export function orderInfo(id) {
    return request({
        url: `/njnzzs/merchant/order/detail/${id}`,
        method: 'GET'
    })
}

// 后付订单
export function preOrders(data) {
    return request({
        url: '/njnzzs/merchant/preOrders',
        method: 'GET',
        data
    })
}

// 审核后付订单
export function preOrderApprove(data) {
    return request({
        url: '/njnzzs/merchant/preOrder/approve',
        method: 'POST',
        data
    })
}

// 商户发货
export function orderDeliver(data) {
    return request({
        url: '/njnzzs/merchant/order/deliver',
        method: 'POST',
        data
    })
}

// 商户确认收货
export function merchantConfirm(id) {
    return request({
        url: `/njnzzs/merchant/delivery/confirm/${id}`,
        method: 'POST'
    })
}

// 确认收款
export function updatePaidUnderLine(data) {
    return request({
        url: '/njnzzs/merchant/order/updatePaidUnderLine',
        method: 'POST',
        data
    })
}